package com.winter.Controller;


import com.winter.model.OrderInfo;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.winter.service.OrderInfoService;
@Controller
@RequestMapping(value = "/orderIno")
public class OrderInfoController {

    @Autowired
    private  OrderInfoService orderInfoService;

    @ResponseBody
    @RequestMapping(value = "/add",
            produces = {"application/json;charset=UTF-8"})
    public int insertOrderInfo(OrderInfo orderInfo){
        return orderInfoService.insertOrder(orderInfo);
    }


    @ResponseBody
    @RequestMapping(value = "/delete/{orderId}",
            produces = {"application/json;charset=UTF-8"})
    public int insertOrderInfo(@PathVariable("orderId") Long orderId){
        return orderInfoService.deleteByPrimaryKey(orderId);
    }


    @RequestMapping(value = "/all/{orderId}", produces = {"application/json;charset=UTF-8"})
    public Object findAllUser(@PathVariable("orderId") Long orderId){

        return orderInfoService.selectByPrimaryKey(orderId);
    }



}
